/* UserCenter.module.css */
.userCenter {
  padding: 0;
}

.userCenterLoading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  font-size: 1.2rem;
  color: #64748b;
}

.loadingSpinner {
  text-align: center;
}

.userCenterHeader {
  margin-bottom: 2rem;
}

.userCenterHeader h1 {
  margin: 0 0 0.5rem 0;
  color: #1e293b;
  font-size: 2rem;
  font-weight: 700;
}

.userCenterHeader p {
  margin: 0;
  color: #64748b;
  font-size: 1.1rem;
}

.userCenterContent {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

/* 侧边栏样式 */
.userSidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebarItem {
  padding: 1rem 1.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.sidebarItem:hover {
  border-color: #3b82f6;
  transform: translateX(4px);
}

.sidebarItemActive {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* 主内容区域 */
.userMain {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.tabContent h2 {
  margin: 0 0 1.5rem 0;
  color: #1e293b;
  font-size: 1.5rem;
  font-weight: 600;
}

/* 个人信息卡片 */
.profileCard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profileHeader {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
}

.profileInfo h3 {
  margin: 0 0 0.5rem 0;
  color: #1e293b;
  font-size: 1.5rem;
}

.userRole {
  margin: 0 0 0.5rem 0;
  color: #64748b;
  font-size: 1rem;
}

.joinDate {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* 表单样式 */
.profileForm,
.securityForm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.formGroup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.formGroup label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.formGroup input {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.formGroup input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.disabledInput {
  background: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
}

.formGroup small {
  color: #6b7280;
  font-size: 0.8rem;
}

.saveBtn {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.saveBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.saveBtn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* 安全设置 */
.securityCard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.securityTips {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.securityTips h4 {
  margin: 0 0 1rem 0;
  color: #1e293b;
}

.securityTips ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #64748b;
}

.securityTips li {
  margin-bottom: 0.5rem;
}

/* 活动记录 */
.activityCard {
  max-height: 600px;
  overflow-y: auto;
}

.activityList {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activityItem {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.activityItem:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.activityIcon {
  font-size: 1.2rem;
  padding-top: 0.2rem;
}

.activityContent {
  flex: 1;
}

.activityDescription {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.activityMeta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #64748b;
}

.activityTime {
  font-weight: 500;
}

.activityIp {
  font-family: 'Courier New', monospace;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .userCenterContent {
    grid-template-columns: 1fr;
  }
  
  .userSidebar {
    flex-direction: row;
    overflow-x: auto;
  }
  
  .sidebarItem {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .userMain {
    padding: 1.5rem;
  }
  
  .profileHeader {
    flex-direction: column;
    text-align: center;
  }
  
  .activityMeta {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* 头像区域样式 */
.avatarSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: white;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.avatarHasAvatar {
  font-size: 0; /* 有图片时隐藏文字 */
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.avatarActions {
  display: flex;
  gap: 0.5rem;
}

.avatarBtn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.changeBtn {
  background: #3b82f6;
  color: white;
}

.changeBtn:hover:not(:disabled) {
  background: #2563eb;
}

.changeBtn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.deleteBtn {
  background: #ef4444;
  color: white;
}

.deleteBtn:hover {
  background: #dc2626;
}

/* 更新个人信息区域的布局 */
.profileHeader {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

/* 文件上传提示 */
.uploadTips {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-top: 1rem;
}

.uploadTips h4 {
  margin: 0 0 0.5rem 0;
  color: #374151;
  font-size: 0.9rem;
}

.uploadTips ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #64748b;
  font-size: 0.8rem;
}

.uploadTips li {
  margin-bottom: 0.25rem;
}